package com.logisticsmanagement.pro_user;

import com.logisticsmanagement.R;

import android.os.Bundle;
import android.app.Activity;
import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;

/**
 * 省公司员工类
 * @author 陈朝辉
 * @createTime 2015年3月17日 下午6:03:41
 * @version 1.0
 */
public class User_ProvinceActivity extends Activity implements OnClickListener{

	private FragmentManager fragmentManager;
	private TextView tvTruckManagement;
	private TextView tvRouteManagement;
	private TextView tvdistributionSiteManagement;
	private TextView tvPriceManagement;
	DistributionSiteManagementProUser distributionSiteManagementProUser;
	PriceManagementProUser priceManagementProUser;
	RouteManagementProUser routeManagementProUser;
	TruckManagementProUser truckManagementProUser;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_user_province);
		
		tvTruckManagement = (TextView)findViewById(R.id.tvTruckManagement);
		tvRouteManagement = (TextView)findViewById(R.id.tvRouteManagement);
		tvdistributionSiteManagement = (TextView)findViewById(R.id.tvDistributionSiteUserPro);
		tvPriceManagement = (TextView)findViewById(R.id.tvPriceManagement);
		
		tvTruckManagement.setOnClickListener(this);
		tvRouteManagement.setOnClickListener(this);
		tvdistributionSiteManagement.setOnClickListener(this);
		tvPriceManagement.setOnClickListener(this);
		
		distributionSiteManagementProUser = new DistributionSiteManagementProUser();
		routeManagementProUser = new RouteManagementProUser();
		priceManagementProUser = new PriceManagementProUser();
		truckManagementProUser = new TruckManagementProUser();
				
		fragmentManager = getFragmentManager();
		FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
		fragmentTransaction.replace(R.id.fl_user_pro, truckManagementProUser).commit();
		
	}

	@Override
	public void onClick(View view) {
		// TODO Auto-generated method stub
		FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
		switch(view.getId()){
		case R.id.tvTruckManagement:
			fragmentTransaction.replace(R.id.fl_user_pro, truckManagementProUser).commit();
			break;
		case R.id.tvRouteManagement:
			fragmentTransaction.replace(R.id.fl_user_pro, routeManagementProUser);
			break;
		case R.id.tvDistributionSiteUserPro:
			fragmentTransaction.replace(R.id.fl_user_pro, distributionSiteManagementProUser);
			break;
		case R.id.tvPriceManagement:
			fragmentTransaction.replace(R.id.fl_user_pro, priceManagementProUser);
			break;
		}
	}

}
